home *** CD-ROM | disk | FTP | other *** search
/ Inside Indy 1993 / Inside Indy 1993.iso / scripts / startchem < prev    next >
Text File  |  1993-06-23  |  2KB  |  134 lines

  1. #!/bin/sh
  2. # ../scripts/start*
  3. # starting from CDROM/slides directory
  4. #
  5. PATH=/bin:/usr/bin:/usr/sbin
  6. case $0
  7. in
  8.     "../scripts/startgis")
  9.             INDYDEMODIR=GIS
  10.             space=22
  11.             RUNDEMO=interactdemo
  12.             ;;
  13.     "../scripts/startchem")
  14.             INDYDEMODIR=CHEM
  15.             space=25
  16.             RUNDEMO=highres
  17.             ;;
  18.     "../scripts/startcase")
  19.             INDYDEMODIR=WorkShop
  20.             space=19
  21.             RUNDEMO="startcasedemo"
  22.             ;;
  23.     "../scripts/startgl")
  24.             INDYDEMODIR=GL
  25.             space=14
  26.             RUNDEMO=powerflip.sh
  27.             ;;
  28.     "../scripts/starttrain")
  29.             INDYDEMODIR=TRAIN
  30.             space=69
  31.             RUNDEMO=trainer.script
  32.             ;;
  33.     *)
  34.             INDYDEMODIR=GL
  35.             space=14
  36.             RUNDEMO="inform \"Error\: No Demo Selected\!\""
  37.             inform "Error: No Demo Selected!"
  38.             exit 1
  39.             ;;
  40. esac
  41.  
  42. if ( test "$INDYTMPDIR" = "" ) ; then
  43.     INDYTMPDIR=/usr/tmp
  44. fi
  45.  
  46. # ask if user want to load files
  47.  
  48. ans=`/usr/sbin/confirm -b "Loaded" -b "Don't Load" -b "Load Now" \
  49. -t "The data for this demo are not loaded." \
  50. -t "It takes approximately ${space}MB of disk space." \
  51. -t "Would you like to load them now?" `
  52.  
  53. case $ans
  54. in
  55. "Load Now")
  56.     runfrom=disk
  57.     if ( test -d $INDYTMPDIR/$INDYDEMODIR ) ; then
  58.         inform "Directory exist, data may already be loaded."
  59.     else
  60.         inform "Copying data..." &
  61.         save=$!
  62.         cp -r ../demos/$INDYDEMODIR $INDYTMPDIR
  63.         if ( test $? -ne 0 ) ; then
  64.             kill $save
  65.             inform "Not enough disk space!"
  66.             exit 1
  67.         fi
  68.         kill $save
  69.     fi
  70.     ;;
  71. "Don't Load")
  72.     ans=`/usr/sbin/confirm -b "Yes" -b "Don't Run" \
  73.     -t "Would you like to run demo from CDROM? It will be very slow!" `
  74.     case $ans
  75.     in
  76.     "Yes")
  77.         runfrom=cdrom
  78.         ;;
  79.     *)
  80.         exit 0
  81.         ;;
  82.     esac
  83.     ;;
  84. "Loaded")
  85.     runfrom=disk
  86.     ;;
  87. esac
  88.  
  89. #change to  demo dir
  90. savedir=`pwd`
  91. if ( test "$runfrom" = "disk" ) ; then
  92.     if ( test -d $INDYTMPDIR/$INDYDEMODIR ) ; then
  93.         cd $INDYTMPDIR/$INDYDEMODIR
  94.     else
  95.         inform "Error: Demo not loaded!"
  96.         exit 1
  97.     fi
  98. else
  99. cd ../demos/$INDYDEMODIR
  100. fi
  101.  
  102. #check demo; rundemo
  103.  
  104. if ( test -f ./$RUNDEMO ) ; then
  105.     ./$RUNDEMO
  106. else
  107.     inform "Error: Demo not loaded!"
  108.     exit 1
  109. fi
  110.  
  111. #change back to original dir
  112. cd $savedir
  113.  
  114. #after run ask if user want to remove
  115. if ( test "$runfrom" = "disk" ) ; then
  116. ans=`confirm -b "No" -b "Remove" \
  117. -t "The data for this demo are not removed." \
  118. -t "Would you like to remove them now?" `
  119. fi
  120.  
  121. case $ans
  122. in
  123. "Remove")
  124.         inform "Removing data!" &
  125.     save=$!
  126.         rm -rf $INDYTMPDIR/$INDYDEMODIR
  127.         kill $save
  128.         ;;
  129. *)
  130.         ;;
  131. esac
  132.  
  133. exit 0
  134.